package com.chushouya.order.constants;


import com.general.framework.core.enums.IEnum;

import java.util.Objects;

public enum OrderTypeEnum implements IEnum<Integer> {
    //快递回收
    EXPRESS_RECYCLE(1, "快递回收"),
    //上门回收
    DOOR_RECYCLE(2, "上门回收");


    private Integer value;

    private String desc;

    OrderTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer status) {
        for (OrderTypeEnum thisEnum : OrderTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, status)) {
                return thisEnum.desc;
            }
        }
        return "O";
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
